package com.dashanchessgame.tools;

import com.dashanchessgame.gameui.CanvasChess;

import javax.swing.*;

/**
 * @author Nessis
 * @since 2023-03-02 14:49
 */
public class WinUtils {
    public static boolean win(int[][] map, int toLineNumber, int toColumnNumber, boolean isChessColor) {
        CanvasChess canvasChess = new CanvasChess();
        if (isChessColor && map[toLineNumber][toColumnNumber] == 'J') {

            JOptionPane.showMessageDialog(null, "黑方胜利！");

            return true;
        } else if (!isChessColor && map[toLineNumber][toColumnNumber] == 1000 + 'J') {
            JOptionPane.showMessageDialog(null, "红方胜利！");

            return true;
        }
        return true;
    }
}
